package com.derek.omshopping.ui.mine.login;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.derek.omshopping.MainActivity;
import com.derek.omshopping.R;
import com.derek.omshopping.WebLoadActivity;
import com.derek.omshopping.base.BaseActivity;
import com.derek.omshopping.ui.mine.BestActivity;
import com.derek.omshopping.ui.mine.register.RegisterActivity;

import butterknife.BindView;
import butterknife.ButterKnife;


public class LoginActivity extends BaseActivity implements View.OnClickListener {

    public static final String WEB_URL = "http://m.ocj.com" +
            ".cn/customers/selectArea?garea=%E5%8C%97%E4%BA%AC%E5%B8%82%E5%8C%97%E4%BA%AC%E5%B8%82";
    private static final String BSET_URL = "https://auth.alipay.com/login/express" +
            ".htm?goto=https%3A%2F%2Fmemberexprod.alipay" +
            ".com%3A443%2Fauthorize%2FuserAuthQuickLoginAction" +
            ".htm%3Fe_i_i_d%3D066355cbf7e51e59c8145ffa56d69ea2";
    @BindView(R.id.login_back)
    ImageView loginBack;
    @BindView(R.id.imageView)
    ImageView imageView;
    @BindView(R.id.textView)
    TextView textView;
    @BindView(R.id.login_address_logo)
    LinearLayout loginAddressLogo;
    @BindView(R.id.vip_login)
    TextView vipLogin;

    @BindView(R.id.personal_password)
    TextView personalPassword;
    @BindView(R.id.personal_check)
    TextView personalCheck;
    @BindView(R.id.personnal_infos)
    LinearLayout personnalInfos;
    @BindView(R.id.personnal_quickly_register)
    TextView personnalQuicklyRegister;
    @BindView(R.id.personnal_quickly_find_password)
    TextView personnalQuicklyFindPassword;
    @BindView(R.id.personal_register)
    Button personalRegister;
    @BindView(R.id.personal_register_cooperate_app)
    TextView personalRegisterCooperateApp;
    @BindView(R.id.besttv_icon)
    ImageView besttvIcon;
    @BindView(R.id.qq_icon)
    ImageView qqIcon;
    @BindView(R.id.zhifubao_icon)
    ImageView zhifubaoIcon;
    @BindView(R.id.weixin_icon)
    ImageView weixinIcon;
    @BindView(R.id.weibo_icon)
    ImageView weiboIcon;


    @Override
    public int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        loginBack.setOnClickListener(this);
        loginAddressLogo.setOnClickListener(this);
        personnalQuicklyRegister.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        int id = v.getId();
        Intent intent = new Intent();
        switch (id) {
            case R.id.login_address_logo:
                intent.setClass(this, WebLoadActivity.class);
                intent.putExtra("webLoadUrl", WEB_URL);
                startActivity(intent);
                break;
            case R.id.login_back:
                intent.setClass(getBaseContext(), MainActivity.class);
                getBaseContext().startActivity(intent);
                break;
            case R.id.personnal_quickly_register:
                intent.setClass(getBaseContext(), RegisterActivity.class);
                getBaseContext().startActivity(intent);
                break;
            case R.id.besttv_icon:
                intent.setClass(this, BestActivity.class);
                intent.putExtra("webLoadUrl", BSET_URL);
                startActivity(intent);
                break;

        }
    }


}